'''
Created on 2011-8-31

@author: Administrator
'''
invalid_request,\
update_machine_request,\
get_cases_request,\
update_task_request,\
insert_task_request,\
insert_os_request,\
get_tasktemplate_request,\
update_subtasks_request,\
end_request, \
insert_taskflow_request, \
update_taskflow_request, \
get_taskflowtemplate_request = range(12)


invalid_respond,\
get_case_respond,\
insert_task_respond,\
machine_dbid_respond,\
insert_os_respond,\
get_tasktemplate_respond,\
end_respond,\
insert_taskflow_respond, \
get_taskflowtemplate_respond = range(9)



class UpdateMachineInfoRequest():
    def __init__(self):
        self.id = update_machine_request
        self.connectid = None
        self.data = None
        self.isrespond = None 
    
class GetCaseRequest():
    id  = get_cases_request
    def __init__(self):
        self.taskid = None
        self.sql = None
    
    
class GetCaseRespond():
    id  = get_case_respond
    def __init__(self):
        self.taskid = 0
        self.result  = True
        self.cases = []

class InsertTaskFlowRequest():
    '''
    task flow insert to db request.
    '''
    id = insert_taskflow_request
    def __init__(self):
        self.taskid = None
        self.templateid = None
        self.createtime = None
        self.status = None
        
class InsertTaskFlowRespond():
    '''
    task flow insert to db respond.
    '''    
    id = insert_taskflow_respond
    def __init__(self):
        self.taskid = None
        self.dbid = None
        self.result = None
        
class UpdateTaskFlowRequest():
    '''
    update task flow db
    '''
    id = update_taskflow_request
    def __init__(self):
        self.taskid = None
        self.task_flow_data = None
        self.node_datas = []
        
class InsertTaskRequest():
    id  = insert_task_request
    def __init__(self):
        self.taskid  = None
        self.templateid = None
        self.createtime = None
        self.status = None
        
class InsertTaskRespond():
    id = insert_task_respond
    def __init__(self):
        self.taskid  = None
        self.dbid = None
        self.result  = None
    
class UpdateTaskRequest():
    id  = update_task_request
    def __init__(self):
        self.taskid = None
        self.data = None

class MachineDbIDRespond():
    def __init__(self):
        self.id  = machine_dbid_respond
        self.connectid = None
        self.dbid = None
        self.groupid = None
        self.enable = None
        self.special = None
    
class InsertNewOSRequest():
    def __init__(self, name):
        self.id  = insert_os_request
        self.name = name
        
class InsertNewOSRespond():
    def __init__(self):
        self.id  = insert_os_respond
        self.resutl = False
        self.name = None
        self.dbid = None
       
class GetTaskFlowTemplateInfo():
    '''
    GetTaskFlowTemplateInfo.
    '''
    def __init__(self):
        self.id = get_taskflowtemplate_request
        self.templateid = None
    
class GetTaskFlowTemplateInfoRespond():
    '''
    GetTaskFlowTemplateInfoRespond.
    '''
    def __init__(self):
        self.id = get_taskflowtemplate_respond
        self.templateid = None
        self.result = None
        self.info = None
        
class GetTaskTemplateInfo():
    def __init__(self):
        self.id  = get_tasktemplate_request
        self.templateid = None

        
class GetTaskTemplateInfoRespond():
    def __init__(self):
        self.id  = get_tasktemplate_respond
        self.templateid = None
        self.result = None
        self.info  = None

class UpdateSubTasksInfo():
    def __init__(self):
        self.id  = update_subtasks_request
        self.infos = []